/**
 * Copyright (c) Software Institude of PKU
 * All rights reserved. 
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 */
package edu.pku.sei.modeler.model.uml.IntermediateActions;
// imports:
import org.w3c.dom.Element;

import edu.pku.sei.gefcommon.descriptor.annotation.MethodProperty;
import edu.pku.sei.modeler.model.common.*;
import edu.pku.sei.modeler.model.core.*;
import edu.pku.sei.modeler.model.xml.XMLUtility;

import edu.pku.sei.modeler.model.uml.BasicActions.InputPin;
import edu.pku.sei.modeler.model.uml.CompleteActions.QualifierValue;
import edu.pku.sei.modeler.uml.modelHelper.ModelPackage;


/**
 * @generated
 *
 */
public class LinkEndCreationData extends LinkEndData implements ILinkEndCreationData {
	// attributes
	
	protected boolean isReplaceAll;
	
	
	
	
	// references
	
	protected MetaTypedList insertAt;
	
	protected MetaTypedList qualifier;
	
	
	
	// getters & setters for attributes
	
	@MethodProperty(
			id = "LINKENDCREATIONDATA_ISREPLACEALL",
			catalog = "Model",
			name = ModelPackage.LINKENDCREATIONDATA_ISREPLACEALL,
			setter = "setisReplaceAll"
			)
	
	public boolean getIsReplaceAll() {
		return isReplaceAll;
	}
	public void setIsReplaceAll(boolean newIsReplaceAll) {
		boolean oldisReplaceAll = isReplaceAll;
		isReplaceAll = newIsReplaceAll;
		firePropertyChange(ModelPackage.LINKENDCREATIONDATA_ISREPLACEALL, oldisReplaceAll, newIsReplaceAll);
	}
	
	// getters for references
	
	public MetaTypedList getInsertAt() {
		if(insertAt == null) {
			insertAt = new MetaTypedList(InputPin.class, this, ModelPackage.LINKENDCREATIONDATA_INSERTAT);
		}
		return insertAt;
	}
	
	public MetaTypedList getQualifier() {
		if(qualifier == null) {
			qualifier = new MetaTypedList(QualifierValue.class, this, ModelPackage.LINKENDCREATIONDATA_QUALIFIER);
		}
		return qualifier;
	}
	
	// save & load
	public void serialize(Element root) {
		super.serialize(root);
		// attributes
		
		XMLUtility.xmlInstance.serializeAttribute(root, ModelPackage.LINKENDCREATIONDATA_ISREPLACEALL, isReplaceAll);
		
		// references
		
		XMLUtility.xmlInstance.serializeNodesNotContain(root, ModelPackage.LINKENDCREATIONDATA_INSERTAT, insertAt);		
		
		XMLUtility.xmlInstance.serializeNodesNotContain(root, ModelPackage.LINKENDCREATIONDATA_QUALIFIER, qualifier);		
		
	}
	
	public void deSerialize(Element root) {
		super.deSerialize(root);
		// attributes
		
		isReplaceAll = XMLUtility.xmlInstance.deSerializeBoolean(root, ModelPackage.LINKENDCREATIONDATA_ISREPLACEALL);
		
		// references
		
		this.getInsertAt().addAll(XMLUtility.xmlInstance.deSerializeNodesNotContain(root, ModelPackage.LINKENDCREATIONDATA_INSERTAT, this));
		
		this.getQualifier().addAll(XMLUtility.xmlInstance.deSerializeNodesNotContain(root, ModelPackage.LINKENDCREATIONDATA_QUALIFIER, this));
		
	}
	
	public void dynamicSet(String featureID, Object value) {
		if(featureID == null || "".equals(featureID)) {
			return;
		}
		// attributes
		
		// references
		
		else if(ModelPackage.LINKENDCREATIONDATA_INSERTAT.equals(featureID)) {
			getInsertAt().add(value);
		}
		
		else if(ModelPackage.LINKENDCREATIONDATA_QUALIFIER.equals(featureID)) {
			getQualifier().add(value);
		}
		
		else
			super.dynamicSet(featureID, value);
	}
}
 
 
 
 
 